<?php
session_start();

include_once("../../Misc.php");
include_once("../../helpers/CHtml.php");
include_once("../../helpers/CJavascript.php");
include_once("../../helpers/Composer.php");
include_once("../../classCol/classOracleDb.php");
include_once("../../models/GFetchers.php");

$GHtml      = new CGHtml;
$GJs        = new CGJavascript;
$Misc       = new Misc;

$CFetchers  = new CGFetchers;

define("_C_B_TYPE_IN"         , "IN");
define("_C_B_TYPE_OUT"        , "OUT");

$Db = new oracleDb;
$Db->init($_SESSION["ORCL"],
          $_SESSION["OPASS"],
          $_SESSION["SID"],
          _NO_COMMENT);

if($Db->connect()){

  switch($_POST["type"]){

    case _C_B_TYPE_IN:

      $srcDb = "CUSTOMER";

      $CFetchers->fetchCustomer($Db,
                                $srcDb,
                                $lstSuppCst);
      break;

    case _C_B_TYPE_OUT:

      $srcDb = "SUPPLIER";

      $CFetchers->fetchSupplier($Db,
                                $srcDb,
                                $lstSuppCst);
      break;

    default:

  }

  $GHtml->initDropDownContent($lstSuppCst,
                              "",
                              $retContent);

  echo  $retContent;

  $Db->dc();
}else{

  $Misc->usrDieJs(_DB_CONN_ERROR);
}

?>